<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="author" th:content="${#servletContext.getAttribute('configMap')['blog_author']}">
        <meta name="description" th:content="${#servletContext.getAttribute('configMap')['description']}" />
        <meta name="keywords" th:content="${#servletContext.getAttribute('configMap')['keywords']}" />
        <meta name="referrer" content="no-referrer" />
        <link th:href="@{${prefix} + '/source/lib/pace/pace-theme-minimal.min.css?v=1.0.2'}" rel="stylesheet">
        <script th:src="@{${prefix} + '/source/lib/pace/pace.min.js?v=1.0.2'}"></script>
        <link th:href="@{${prefix} + '/source/lib/fancybox/source/jquery.fancybox.css?v=2.1.5'}" rel="stylesheet" type="text/css">
        <link th:href="@{${prefix} + '/source/lib/font-awesome/css/font-awesome.min.css?v=4.6.2'}" rel="stylesheet" type="text/css">
        <link rel="stylesheet" th:href="@{'/admin/assets/custom/jquery-search/jquery.search.css'}"/>
        <link th:href="@{${prefix} + '/source/css/' + ${activeTheme.configMap['scheme']} + '_main.css?v=5.1.4'}" rel="stylesheet" type="text/css">
        <link th:href="@{${prefix} + '/source/css/style.css?v=1.0.2'}" rel="stylesheet">
        <link rel="stylesheet" th:href="@{${prefix} + '/source/js/highlightjs/styles/github-gist.min.css'}"/>
        <link rel="stylesheet" th:href="@{${prefix} + '/source/js/overshare/css/share.min.css'}"/>
        <link th:href="@{${prefix} + '/source/images/apple-touch-icon-next.png?v=5.1.4'}" rel="apple-touch-icon" sizes="180x180" >
        <link th:href="@{${prefix} + '/source/images/favicon-32x32-next.png?v=5.1.4'}" rel="icon" type="image/png" sizes="32x32" >
        <link th:href="@{${prefix} + '/source/images/favicon-16x16-next.png?v=5.1.4'}" rel="icon" type="image/png" sizes="16x16" >
        <link th:href="@{${prefix} + '/source/images/logo.svg?v=5.1.4'}" color="#222" rel="mask-icon" >

        <script type="text/javascript" id="hexo.configurations">
            var NexT = window.NexT || {};
            var CONFIG = {
                root: '/',
                scheme: 'Pisces',
                version: '5.1.4',
                sidebar: {
                    "position": "left",
                    "display": "post",
                    "offset": 12,
                    "b2t": false,
                    "scrollpercent": false,
                    "onmobile": false
                },
                fancybox: true,
                tabs: true,
                motion: {
                    "enable": true,
                    "async": false,
                    "transition": {
                        "post_block": "fadeIn",
                        "post_header": "slideDownIn",
                        "post_body": "slideDownIn",
                        "coll_header": "slideLeftIn",
                        "sidebar": "slideUpIn"
                    }
                },
            };
        </script>
        <link rel="canonical" th:href="@{${activeTheme.configMap['homePage']}}">
    </head>

    <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

        <div th:class="${isDetail == true ? 'container sidebar-position-left page-post-detail' : 'container sidebar-position-left page-home'}">
            <div class="headband"></div>

            <!-- header start -->
            <div>
                <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
                    <div class="header-inner">
                        <div class="site-brand-wrapper">
                            <div class="site-meta ">
                                <div class="custom-logo-site-title">
                                    <a href="/" class="brand" rel="start">
                                        <span class="logo-line-before"><i></i></span>
                                        <span class="site-title" th:text="${#servletContext.getAttribute('configMap')['blog_name']}"></span>
                                        <span class="logo-line-after"><i></i></span>
                                    </a>
                                </div>
                                <h1 class="site-subtitle" itemprop="description"></h1>
                            </div>
                            <div class="site-nav-toggle">
                                <button>
                                    <span class="btn-bar"></span>
                                    <span class="btn-bar"></span>
                                    <span class="btn-bar"></span>
                                </button>
                            </div>
                        </div>
                            <nav class="site-nav">
                                <ul id="menu" class="menu">
                                    <li th:each="nav : ${#servletContext.getAttribute('firstNav')}" th:class="${currentNav.code eq nav.code ? 'menu-item menu-item-active' : 'menu-item'}">
                                        <a th:href="@{${#lists.isEmpty(nav.children) ? nav.link : '#'}}" th:class="${#lists.isEmpty(nav.children) ? '' : 'open'}">
                                            <i th:class="${nav.icon}"></i> [[${nav.name}]]
                                            <span th:if="${#lists.isEmpty(nav.children) == false}" class="menu-arrow">
                                                <i class="fa fa-caret-down"></i>
                                            </span>
                                        </a>
                                        <ul class="second-menu" th:if="${#lists.isEmpty(nav.children) == false}">
                                            <li class="item" th:each="child : ${nav.children}">
                                                <a th:href="@{${child.link}}"><i th:class="${child.icon}"></i> [[${child.name}]]</a>
                                            </li>
                                        </ul>
                                    </li>
                                    <li class="menu-item menu-item-search">
                                        <a href="javascript:void(0)" rel="section" data-real-time-search>
                                            <i class="menu-item-icon fa fa-fw fa-search"></i> 搜索
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                    </div>
                </header>
            </div>
            <!-- header end -->

            <!-- sidebar start -->
            <main id="main" class="main">
                <div class="main-inner">
                    <div class="content-wrap">
                        <div layout:fragment="content"></div>
                    </div>
                    <div>
                        <div class="sidebar-toggle">
                            <div class="sidebar-toggle-line-wrap">
                                <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
                                <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
                                <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
                            </div>
                        </div>

                        <aside id="sidebar" class="sidebar">
                            <div class="sidebar-inner">

                                <ul class="sidebar-nav motion-element" th:if="${isDetail == true}">
                                    <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
                                        文章目录
                                    </li>
                                    <li class="sidebar-nav-overview" data-target="site-overview-wrap">
                                        站点概览
                                    </li>
                                </ul>

                                <section th:class="${isDetail == false ? 'site-overview-wrap sidebar-panel sidebar-panel-active' : 'site-overview-wrap sidebar-panel'}">
                                    <div class="site-overview">
                                        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
                                            <img class="site-author-image" itemprop="image" th:src="@{${#strings.isEmpty(#servletContext.getAttribute('configMap')['logo_url']) != true ? #servletContext.getAttribute('configMap')['logo_url'] : prefix + '/source/images/logo.png'}}" th:alt="${#servletContext.getAttribute('configMap')['blog_author']}">
                                            <p class="site-author-name" itemprop="name" th:text="${#servletContext.getAttribute('configMap')['blog_author']}"></p>
                                            <p class="site-description motion-element" itemprop="description"></p>
                                        </div>
                                        <nav class="site-state motion-element">
                                            <div class="site-state-item site-state-posts">
                                                <a href="/archives">
                                                    <span class="site-state-item-count" th:text="${#servletContext.getAttribute('postNum')}">0</span>
                                                    <span class="site-state-item-name">日志</span>
                                                </a>
                                            </div>
                                            <div class="site-state-item site-state-categories">
                                                <a href="/categories/index.html">
                                                    <span class="site-state-item-count" th:text="${#servletContext.getAttribute('categoryNum')}">0</span>
                                                    <span class="site-state-item-name">分类</span>
                                                </a>
                                            </div>
                                            <div class="site-state-item site-state-tags">
                                                <a href="/tags/index.html">
                                                    <span class="site-state-item-count" th:text="${#servletContext.getAttribute('tagNum')}">0</span>
                                                    <span class="site-state-item-name">标签</span>
                                                </a>
                                            </div>
                                        </nav>

                                        <div class="links-of-author motion-element">
                                          <span class="links-of-author-item" th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['git_hub_account']) != true}">
                                            <a th:href="@{${#servletContext.getAttribute('configMap')['git_hub_account']}}" target="_blank" title="GitHub">
                                                <i class="fa fa-fw fa-github"></i>GitHub
                                            </a>
                                          </span>
                                                            <span class="links-of-author-item" th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['email']) != true}">
                                            <a th:href="@{'mailto:' + ${#servletContext.getAttribute('configMap')['email']}}" target="_blank" title="E-Mail">
                                                <i class="fa fa-fw fa-envelope"></i>E-Mail
                                            </a>
                                          </span>
                                                            <span class="links-of-author-item" th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['qq_account']) != true}">
                                            <a th:href="@{'javascript:' + ${#servletContext.getAttribute('configMap')['qq_account']}}" target="_blank" th:title="QQ">
                                                <i class="fa fa-fw fa-globe"></i>QQ
                                            </a>
                                          </span>
                                                            <span class="links-of-author-item" th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['wx_account']) != true}">
                                            <a th:href="@{'javascript:' + ${#servletContext.getAttribute('configMap')['wx_account']}}" target="_blank" th:title="微信">
                                                <i class="fa fa-fw fa-twitter"></i>微信
                                            </a>
                                          </span>
                                      </div>

                                        <div class="links-of-blogroll motion-element links-of-blogroll-block">
                                            <div class="links-of-blogroll-title">
                                                <i class="fa  fa-fw fa-link"></i>
                                                友链
                                            </div>
                                            <ul class="links-of-blogroll-list">
                                                <li class="links-of-blogroll-item" th:each="friendLink : ${#servletContext.getAttribute('friendLinkList')}">
                                                    <a th:href="@{${friendLink.homeUrl}}" th:title="${friendLink.title}" target="_blank" th:text="${friendLink.title}"></a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </section>

                                <!--noindex-->
                                <section th:if="${isDetail == true}" class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
                                    <div class="post-toc">
                                        <div class="post-toc-content" id="postTocContent"></div>
                                    </div>
                                </section>
                                <!--/noindex-->

                            </div>
                        </aside>
                    </div>
                </div>
            </main>
            <!-- sidebar end -->

            <!-- footer start -->
            <footer id="footer" class="footer">
                <div class="footer-inner">
                    <div class="copyright"><span itemprop="copyrightYear" th:utext="${#servletContext.getAttribute('configMap')['power_by']}"></span>
                        <span class="author" itemprop="copyrightHolder" th:utext="${#servletContext.getAttribute('configMap')['anchor']}"></span>
                    </div>

                    <div class="theme-info">主题来自
                        <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a>
                        v5.1.4
                    </div>

                </div>
            </footer>
            <!-- footer end -->

            <div class="real-time-search-container" id="real-time-search-container"></div>

            <div class="back-to-top">
                <i class="fa fa-arrow-up"></i>
            </div>

        </div>
        <script type="text/javascript">
            if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
                window.Promise = null;
            }
        </script>

        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/jquery/index.js?v=2.1.3'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/fastclick/lib/fastclick.min.js?v=1.0.6'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/velocity/velocity.min.js?v=1.2.1'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/velocity/velocity.ui.min.js?v=1.2.1'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/utils.js?v=5.1.4'}"></script>
        <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/motion.js?v=5.1.4'}"></script>
        <span th:if="${activeTheme.configMap['scheme'] == 'Pisces' || activeTheme.configMap['scheme'] == 'Gemini'}">
            <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/affix.js?v=5.1.4'}"></script>
            <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/schemes/pisces.js?v=5.1.4'}"></script>
        </span>
        <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/bootstrap.js?v=5.1.4'}"></script>
        <script type='text/javascript' th:src="@{'/admin/assets/custom/jquery-search/jquery.hideseek.min.js'}" ></script>
        <script type='text/javascript' th:src="@{'/admin/assets/custom/jquery-search/jquery.search.js'}" ></script>
        <script type='text/javascript'>
            $("#real-time-search-container").RealTimeSearch({
                listUrl: "/postList.json"
            });
            $("a.open").on("click", function () {
                $(this).next("ul.second-menu").toggleClass("show");
            });
        </script>
        <span th:if="${isDetail}">
            <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/scrollspy.js?v=5.1.4'}"></script>
            <script type="text/javascript" th:src="@{${prefix} + '/source/js/src/post-details.js?v=5.1.4'}"></script>
            <script type='text/javascript' th:src="@{${prefix} + '/source/js/highlightjs/highlight.pack.js'}"></script>
            <script type='text/javascript' th:src="@{${prefix} + '/source/js/overshare/js/social-share.min.js'}"></script>
            <script type='text/javascript' th:src="@{${prefix} + '/source/js/layer/layer.js'}"></script>
            <script type='text/javascript' th:src="@{${prefix} + '/source/js/toc.js'}"></script>
            <script>
                document.addEventListener('DOMContentLoaded', function() {
                    document.querySelectorAll('figure span').forEach(function(block) {
                        hljs.highlightBlock(block);
                    });
                });

                $("#postTocContent").html(tocHelper("post-content", "nav"));

                $("#priseBtn").on("click",function () {
                    let postId = $(this).data("id");
                    let key = "post-hasPrize" + postId;
                    if (sessionStorage.getItem(key)) {
                        layer.msg("已点赞");
                        return;
                    }

                    $.post("/praisePost/" + postId, null, function (resp) {
                        if (resp.success) {
                            $("#prizeCount").text(resp.data);
                            sessionStorage.setItem(key, "y");
                            layer.msg("谢谢点赞");
                        }
                    },"json");

                });

                $("#shareOpenBtn").on("click",function () {
                    let shareBtns = $("#shareBtns");
                    if (shareBtns.hasClass("share-open")) {
                        shareBtns.removeClass("share-open");
                    } else {
                        shareBtns.addClass("share-open");
                    }
                });
            </script>
        </span>

    </body>

</html>